package com.yanqu.road.server.cmd.beautyescort;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.beautyescort.BeautyEscortProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.beautyescort.CrossBeautyEscortCacheMgr;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.YanQuMessageUtils;

@Cmd(code = Protocol.C_BEAUTY_ESCORT_GET_UNION_MEMBER_DATA, desc = "商会成员贡献榜")
public class CrossBeautyEscortRankMemberDataCmd extends CrossCommand {

    BeautyEscortProto.BeautyEscortRankMemberDataReqMsg reqMsg;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        reqMsg = BeautyEscortProto.BeautyEscortRankMemberDataReqMsg.parseFrom(packet.getBytes());
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        BeautyEscortProto.BeautyEscortRankMemberDataRespMsg.Builder respMsg = CrossBeautyEscortCacheMgr.getRankMemberDataList(reqMsg.getWeekId(), reqMsg.getUnionUid());
        MessageHelper.sendPacket(serverId, packet.getPlayerId(), YanQuMessageUtils.buildMessage(Protocol.U_BEAUTY_ESCORT_GET_UNION_MEMBER_DATA, respMsg));
        /*BeautyEscortProto.CrossBeautyEscortRankMemberDataReqMsg.Builder msg = BeautyEscortProto.CrossBeautyEscortRankMemberDataReqMsg.newBuilder();
        msg.setPlayerId(packet.getPlayerId());
        msg.setPlayerServerId(serverId);
        msg.setServerId(reqMsg.getServerId());
        msg.setWeekId(reqMsg.getWeekId());
        msg.setUnionUid(reqMsg.getUnionUid());
        MessageHelper.sendChannelPacket(reqMsg.getServerId(), 0, YanQuMessageUtils.buildMessage(Protocol.S_BEAUTY_ESCORT_GET_UNION_MEMBER_DATA_FROM_CROSS, msg));*/
    }

    @Override
    public void sendData() {

    }
}
